home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / C⁄C++ / Kant Generator Pro 1.2 / src / kode ƒ / kant build window.c < prev    next >
C/C++ Source or Header  |  1995-02-10  |  15KB  |  582 lines

  1. #include "kant build window.h"
  2. #include "kant build lists.h"
  3. #include "kant build dispatch.h"
  4. #include "program globals.h"
  5. #include "buttons.h"
  6. #include "environment.h"
  7. #include "window layer.h"
  8. #include "menus.h"
  9. #include "main.h"
  10. #include "text twiddling.h"
  11. #include "resource utilities.h"
  12. #include "util.h"
  13. #include "list layer.h"
  14. #include <Icons.h>
  15.  
  16. #define DEAD_SPACE_H        10
  17. #define DEAD_SPACE_V        10
  18. #define BUTTON_GAP            1
  19. #define BUTTON_WIDTH        24
  20. #define BUTTON_HEIGHT        24
  21. #define MESSAGE_HEIGHT        19
  22. #define HEADER_SPACE        (DEAD_SPACE_V*3+BUTTON_HEIGHT+MESSAGE_HEIGHT)
  23. #define HEADER_NO_MESSAGE    (DEAD_SPACE_V*2+BUTTON_HEIGHT)
  24. #define HEADER_NO_TOOLBAR    0
  25. #define kHeaderHeight        (gShowToolbar ? (gShowMessageBox ? HEADER_SPACE : HEADER_NO_MESSAGE) : HEADER_NO_TOOLBAR)
  26. #define kGrowBoxSize        15
  27.  
  28. enum { key_LeftArrow=0x1c, key_RightArrow, key_UpArrow, key_DownArrow };
  29. enum { key_Home=0x01, key_End=0x04, key_PageUp=0x0b, key_PageDown };
  30. enum { key_Tab='\t' };
  31. enum { key_Return='\r', key_Enter=0x03 };
  32. enum { key_Delete=0x08 };
  33.  
  34. #define kFirstBuildButtonID    600
  35. #define kBuildMessagesID    500
  36. #define NUM_BUTTONS            7
  37.  
  38. enum { kNewRefButton=0, kNewInstantButton, kEditRefButton, kDeleteRefButton,
  39.         kMarkInterestingButton, kShowMessageButton, kHideToolbarButton };
  40.  
  41. enum { kNewRefMessage=1, kNewInstantMessage, kEditRefMessage, kDeleteRefMessage,
  42.         kMarkInterestingMessage, kHideMessageMessage, kHideToolbarMessage,
  43.         kEditInstantMessage, kDeleteInstantMessage, kMarkUninterestingMessage,
  44.         kBlankMessage, kNewInstantDimmedMessage, kEditRefDimmedMessage,
  45.         kDeleteRefDimmedMessage, kMarkInterestingDimmedMessage, kEditInstantDimmedMessage,
  46.         kDeleteInstantDimmedMessage };
  47.  
  48. static    Boolean ButtonIsDimmedQQ(WindowPtr theWindow, short buttonNum);
  49. static    void SetTheBuildMessage(WindowPtr theWindow, short messageIndex, Boolean redraw);
  50. static    void DrawTheBuildMessage(WindowPtr theWindow, Boolean drawFrame);
  51. static    void DrawBuildHeader(WindowPtr theWindow, short theDepth);
  52.  
  53. static    Str255            gBuildWindowTitle;
  54. static    Rect            gButtonRect[NUM_BUTTONS];
  55. static    Handle            gButtonIcon[NUM_BUTTONS];    /* handle to icon suite */
  56. static    Str255            gTheMessage;
  57. static    short            gTheMessageID;
  58. static    Boolean            gOldButtonState[NUM_BUTTONS];
  59. static    Boolean            gSetupDone=FALSE;
  60.  
  61. void SetupTheBuildWindow(WindowPtr theWindow)
  62. {
  63.     unsigned char    *titleStr="\puntitled";
  64.     Point            topLeft;
  65.     FSSpec            fs;
  66.     short            i;
  67.     
  68.     SetWindowHeight(theWindow, qd.screenBits.bounds.bottom-qd.screenBits.bounds.top-LMGetMBarHeight()-48);
  69.     SetWindowWidth(theWindow, qd.screenBits.bounds.right-qd.screenBits.bounds.left-70);
  70.     SetWindowType(theWindow, zoomDocProc);
  71.     topLeft.v=qd.screenBits.bounds.top+LMGetMBarHeight()+40;
  72.     topLeft.h=qd.screenBits.bounds.left+30;
  73.     SetWindowTopLeft(theWindow, topLeft);
  74.     SetWindowHasCloseBox(theWindow, TRUE);
  75.     SetWindowMaxDepth(theWindow, 8);
  76.     SetWindowDepth(theWindow, 8);
  77.     SetWindowIsFloat(theWindow, FALSE);
  78.     if (gBuildWindowTitle[0]==0x00)
  79.     {
  80.         SetWindowTitle(theWindow, titleStr);
  81.     }
  82.     else
  83.     {
  84.         SetWindowTitle(theWindow, gBuildWindowTitle);
  85.     }
  86.     
  87.     SetWindowAutoCenter(theWindow, FALSE);
  88.     fs.name[0]=0x00;
  89.     fs.vRefNum=0;
  90.     fs.parID=0;
  91.     SetWindowFS(theWindow, fs);
  92.     SetWindowIsModified(theWindow, FALSE);
  93.     SetWindowDrawGrowIconLines(theWindow, FALSE);
  94.     
  95.     if (gSetupDone)
  96.         return;
  97.     
  98.     gSetupDone=TRUE;
  99.     gNeedToOpenWindow=FALSE;
  100.     for (i=0; i<NUM_BUTTONS; i++)
  101.     {
  102.         SetRect(&gButtonRect[i], DEAD_SPACE_H+i*(BUTTON_WIDTH+BUTTON_GAP), DEAD_SPACE_V,
  103.             DEAD_SPACE_H+i*(BUTTON_WIDTH+BUTTON_GAP)+BUTTON_WIDTH, DEAD_SPACE_V+BUTTON_HEIGHT);
  104.         GetIconSuite(&gButtonIcon[i], kFirstBuildButtonID+i, svAllSmallData);
  105.     }
  106.     SetTheBuildMessage(theWindow, 0, FALSE);
  107.     InitTheBuildLists();
  108. }
  109.  
  110. void ShutDownTheBuildWindow(void)
  111. {
  112.     short            i;
  113.     
  114.     for (i=0; i<NUM_BUTTONS; i++)
  115.         gButtonIcon[i]=SafeDisposeIconSuite(gButtonIcon[i]);
  116. }
  117.  
  118. void OpenTheBuildWindow(WindowPtr theWindow)
  119. {
  120.     theWindow->txFont=geneva;
  121.     theWindow->txSize=9;
  122.     
  123.     SetMaxReferenceDisplay(5, FALSE);
  124.     SetBuildListRects(theWindow, DEAD_SPACE_H, DEAD_SPACE_V, kHeaderHeight);
  125.     CreateBuildLists(theWindow);
  126.     SetReferenceListActive(FALSE);
  127.     SetWindowIsActive(theWindow, TRUE);
  128.     AdjustMenus();
  129. }
  130.  
  131. void IdleInBuildWindow(WindowPtr theWindow, Point mouseLoc)
  132. {
  133.     short            i;
  134.     Boolean            gotone;
  135.     short            id;
  136.     
  137.     if (!gShowToolbar || !gShowMessageBox)
  138.         return;
  139.     
  140.     for (i=0, gotone=FALSE; ((i<NUM_BUTTONS) && (!gotone)); i++)
  141.     {
  142.         if (PtInRect(mouseLoc, &gButtonRect[i]))
  143.         {
  144.             gotone=TRUE;
  145.             switch (i)
  146.             {
  147.                 case kNewRefButton:
  148.                     id=kNewRefMessage;
  149.                     break;
  150.                 case kNewInstantButton:
  151.                     id=(ButtonIsDimmedQQ(theWindow, i)) ? kNewInstantDimmedMessage : kNewInstantMessage;
  152.                     break;
  153.                 case kEditRefButton:
  154.                     id=(ReferenceListActiveQQ()) ?
  155.                         (ButtonIsDimmedQQ(theWindow, i)) ? kEditRefDimmedMessage : kEditRefMessage :
  156.                         (ButtonIsDimmedQQ(theWindow, i)) ? kEditInstantDimmedMessage : kEditInstantMessage;
  157.                     break;
  158.                 case kDeleteRefButton:
  159.                     id=(ReferenceListActiveQQ()) ?
  160.                         (ButtonIsDimmedQQ(theWindow, i)) ? kDeleteRefDimmedMessage : kDeleteRefMessage :
  161.                         (ButtonIsDimmedQQ(theWindow, i)) ? kDeleteInstantDimmedMessage : kDeleteInstantMessage;
  162.                     break;
  163.                 case kMarkInterestingButton:
  164.                     id=(ButtonIsDimmedQQ(theWindow, i)) ? kMarkInterestingDimmedMessage :
  165.                         (HighlightedReferenceInterestingQQ()) ? kMarkUninterestingMessage :
  166.                         kMarkInterestingMessage;
  167.                     break;
  168.                 case kShowMessageButton:
  169.                     id=kHideMessageMessage;
  170.                     break;
  171.                 case kHideToolbarButton:
  172.                     id=kHideToolbarMessage;
  173.                     break;
  174.             }
  175.             if (id!=gTheMessageID)
  176.                 SetTheBuildMessage(theWindow, id, TRUE);
  177.         }
  178.     }
  179.     
  180.     if ((!gotone) && (gTheMessageID!=kBlankMessage))
  181.         SetTheBuildMessage(theWindow, kBlankMessage, TRUE);
  182. }
  183.  
  184. void KeyPressedInBuildWindow(WindowPtr theWindow, unsigned char theChar)
  185. {
  186.     Boolean            refActive;
  187.     short            highlightedIndex, newIndex;
  188.     short            max, numVisible;
  189.     ListHandle        theList;
  190.     Cell            theCell;
  191.     
  192.     refActive=ReferenceListActiveQQ();
  193.     theList=refActive ? GetReferenceListHandle() : GetInstantListHandle();
  194.     highlightedIndex=refActive ? GetHighlightedReference() : GetHighlightedInstant();
  195.     max=refActive ? GetNumberOfReferences() : GetNumberOfInstants();
  196.     numVisible=refActive ? GetNumberOfVisibleReferences() : GetNumberOfVisibleInstants();
  197.     newIndex=-2;
  198.     
  199.     RememberBuildButtonState(theWindow);
  200.     
  201.     switch (theChar)
  202.     {
  203.         case key_Tab:
  204.             if (refActive)
  205.                 SetInstantListActive(TRUE);
  206.             else
  207.                 SetReferenceListActive(TRUE);
  208.             break;
  209.         case key_UpArrow:
  210.         case key_LeftArrow:
  211.             newIndex=(highlightedIndex<=0) ? max-1 : highlightedIndex-1;
  212.             /* no break intentionally */
  213.         case key_DownArrow:
  214.         case key_RightArrow:
  215.             if (newIndex==-2)
  216.                 newIndex=((highlightedIndex==-1) || (highlightedIndex==max-1)) ? 0 : highlightedIndex+1;
  217.             SetPt(&theCell, 0, newIndex);
  218.             MySelectOneCell(theList, theCell);
  219.             if (refActive)
  220.                 BuildInstantListHandle(GetWindowFS(theWindow), TRUE);
  221.             break;
  222.         case key_Home:
  223.             MyScrollList(theList, -max);
  224.             break;
  225.         case key_End:
  226.             MyScrollList(theList, max);
  227.             break;
  228.         case key_PageUp:
  229.             MyScrollList(theList, -numVisible);
  230.             break;
  231.         case key_PageDown:
  232.             MyScrollList(theList, numVisible);
  233.             break;
  234.         case key_Return:
  235.         case key_Enter:
  236.             if (highlightedIndex>=0)
  237.                 DoEditDispatch(theWindow);
  238.             break;
  239.         case key_Delete:
  240.             if (highlightedIndex>=0)
  241.                 DoDeleteDispatch(theWindow);
  242.             break;
  243.     }
  244.  
  245.     UpdateBuildButtons(theWindow, TRUE);
  246. }
  247.  
  248. Boolean MouseClickedInBuildWindow(WindowPtr theWindow, Point thePoint, Boolean dynamicScroll)
  249. {
  250.     Boolean            gotone;
  251.     short            i;
  252.     short            theDepth;
  253.     Rect            refRect, instantRect;
  254.     ListHandle        refList, instantList;
  255.     Boolean            doubleClick;
  256.     short            oldReference;
  257.     
  258.     if (gInProgress)
  259.         return TRUE;
  260.     
  261.     theDepth=GetWindowDepth(theWindow);
  262.     RememberBuildButtonState(theWindow);
  263.     
  264.     for (i=0, gotone=FALSE; ((i<NUM_BUTTONS) && (!gotone)); i++)
  265.     {
  266.         if ((PtInRect(thePoint, &gButtonRect[i])) && (!ButtonIsDimmedQQ(theWindow, i)))
  267.         {
  268.             gotone=TRUE;
  269.             if (Track3DButton(&gButtonRect[i], 0L, gButtonIcon[i], theDepth, FALSE))
  270.             {
  271.                 switch (i)
  272.                 {
  273.                     case kNewRefButton:
  274.                         DoNewDispatch(theWindow, TRUE);
  275.                         break;
  276.                     case kNewInstantButton:
  277.                         DoNewDispatch(theWindow, FALSE);
  278.                         break;
  279.                     case kEditRefButton:
  280.                         DoEditDispatch(theWindow);
  281.                         break;
  282.                     case kDeleteRefButton:
  283.                         DoDeleteDispatch(theWindow);
  284.                         break;
  285.                     case kMarkInterestingButton:
  286.                         DoMarkInterestingDispatch(theWindow);
  287.                         break;
  288.                     case kShowMessageButton:
  289.                         DoShowMessageDispatch(theWindow);
  290.                         break;
  291.                     case kHideToolbarButton:
  292.                         DoShowToolbarDispatch(theWindow);
  293.                         break;
  294.                 }
  295.             }
  296.         }
  297.     }
  298.     
  299.     if (!gotone)
  300.     {
  301.         refList=GetReferenceListHandle();
  302.         instantList=GetInstantListHandle();
  303.         GetReferenceListRect(&refRect);
  304.         GetInstantListRect(&instantRect);
  305.         
  306.         if (PtInRect(thePoint, &refRect))
  307.         {
  308.             oldReference=GetHighlightedReference();
  309.             SetReferenceListActive(TRUE);
  310.             doubleClick=MyHandleMouseDownInList(refList, thePoint, GetTheModifiers());
  311.             if (oldReference!=GetHighlightedReference())
  312.                 BuildInstantListHandle(GetWindowFS(theWindow), TRUE);
  313.             if (doubleClick)
  314.                 DoEditDispatch(theWindow);
  315.         }
  316.         else if (PtInRect(thePoint, &instantRect))
  317.         {
  318.             SetInstantListActive(TRUE);
  319.             if (MyHandleMouseDownInList(instantList, thePoint, GetTheModifiers()))
  320.                 DoEditDispatch(theWindow);
  321.         }
  322.     }
  323.     
  324.     UpdateBuildButtons(theWindow, TRUE);
  325.     return TRUE;
  326. }
  327.  
  328. void DisposeTheBuildWindow(WindowPtr theWindow)
  329. {
  330.     DisposeBuildLists();
  331. }
  332.  
  333. void CopybitsTheBuildWindow(WindowPtr theWindow, WindowPtr offscreenWindowPtr, Boolean active,
  334.     Boolean drawGrowIconLines)
  335. {
  336.     Rect            tempRect;
  337.     RgnHandle        copyRgn, listRgn;
  338.     ListHandle        refList, instantList;
  339.     Rect            refRect, instantRect;
  340.     
  341.     refList=GetReferenceListHandle();
  342.     instantList=GetInstantListHandle();
  343.     GetReferenceListRect(&refRect);
  344.     GetInstantListRect(&instantRect);
  345.     
  346.     copyRgn=NewRgn();
  347.     listRgn=NewRgn();
  348.     RectRgn(copyRgn, &(theWindow->portRect));
  349.     RectRgn(listRgn, &refRect);
  350.     InsetRgn(listRgn, -4, -4);
  351.     DiffRgn(copyRgn, listRgn, copyRgn);
  352.     SetEmptyRgn(listRgn);
  353.     RectRgn(listRgn, &instantRect);
  354.     InsetRgn(listRgn, -4, -4);
  355.     DiffRgn(copyRgn, listRgn, copyRgn);
  356.     
  357.     CopyBits(    &(offscreenWindowPtr->portBits),
  358.                 &(theWindow->portBits),
  359.                 &(theWindow->portRect),
  360.                 &(theWindow->portRect), 0, copyRgn);
  361.     
  362.     if (active)
  363.     {
  364.         DrawGrowIconNoLines(theWindow, drawGrowIconLines);
  365.     }
  366.     else
  367.     {
  368.         tempRect.bottom=theWindow->portRect.bottom;
  369.         tempRect.right=theWindow->portRect.right;
  370.         tempRect.left=tempRect.right-kGrowBoxSize+1;
  371.         tempRect.top=tempRect.bottom-kGrowBoxSize+1;
  372.         EraseRect(&tempRect);
  373.     }
  374.     
  375.     UpdateBuildLists(theWindow);
  376.     
  377.     DisposeRgn(copyRgn);
  378.     DisposeRgn(listRgn);
  379. }
  380.  
  381. void DrawTheBuildWindow(WindowPtr theWindow, short theDepth)
  382. {
  383.     RGBColor        oldForeColor, oldBackColor;
  384.     GrafPtr            curPort;
  385.     
  386.     if (theDepth>2)
  387.     {
  388.         GetForeColor(&oldForeColor);
  389.         GetBackColor(&oldBackColor);
  390.     }
  391.     
  392.     GetPort(&curPort);
  393.     EraseRect(&(curPort->portRect));
  394.     
  395.     if (kHeaderHeight>0)
  396.     {
  397.         DrawBuildHeader(theWindow, theDepth);
  398.     }
  399.     
  400.     if (theDepth>2)
  401.     {
  402.         RGBForeColor(&oldForeColor);
  403.         RGBBackColor(&oldBackColor);
  404.     }
  405. }
  406.  
  407. void ActivateTheBuildWindow(WindowPtr theWindow, Boolean drawGrowIconLines)
  408. {
  409.     ListHandle        refList, instantList;
  410.     
  411.     refList=GetReferenceListHandle();
  412.     instantList=GetInstantListHandle();
  413.     LActivate(TRUE, refList);
  414.     LActivate(TRUE, instantList);
  415.     MyDrawActiveListBorder(refList, ReferenceListActiveQQ());
  416.     MyDrawActiveListBorder(instantList, InstantListActiveQQ());
  417.     DrawGrowIconNoLines(theWindow, drawGrowIconLines);
  418. }
  419.  
  420. void DeactivateTheBuildWindow(WindowPtr theWindow)
  421. {
  422.     Rect            tempRect;
  423.     ListHandle        refList, instantList;
  424.     
  425.     refList=GetReferenceListHandle();
  426.     instantList=GetInstantListHandle();
  427.     LActivate(FALSE, refList);
  428.     LActivate(FALSE, instantList);
  429.     MyDrawActiveListBorder(refList, FALSE);
  430.     MyDrawActiveListBorder(instantList, FALSE);
  431.     tempRect.bottom=theWindow->portRect.bottom;
  432.     tempRect.right=theWindow->portRect.right;
  433.     tempRect.left=tempRect.right-kGrowBoxSize+1;
  434.     tempRect.top=tempRect.bottom-kGrowBoxSize+1;
  435.     EraseRect(&tempRect);
  436. }
  437.  
  438. void ResizeTheBuildWindow(WindowPtr theWindow)
  439. {
  440.     ResizeBuildLists(theWindow, DEAD_SPACE_H, DEAD_SPACE_V, kHeaderHeight);
  441. }
  442.  
  443. void GetGrowSizeTheBuildWindow(WindowPtr theWindow, Rect *sizeRect)
  444. {
  445.     GetGrowSizeTheLists(sizeRect, DEAD_SPACE_H, DEAD_SPACE_V, HEADER_SPACE);
  446. }
  447.  
  448. static    Boolean ButtonIsDimmedQQ(WindowPtr theWindow, short buttonNum)
  449. {
  450.     switch (buttonNum)
  451.     {
  452.         case kNewRefButton:
  453.         case kShowMessageButton:
  454.         case kHideToolbarButton:
  455.             return FALSE;
  456.         case kNewInstantButton:
  457.             return (GetHighlightedReference()<0);
  458.         case kEditRefButton:
  459.         case kDeleteRefButton:
  460.             return (ReferenceListActiveQQ() ?
  461.                 (GetHighlightedReference()<0) : (GetHighlightedInstant()<0));
  462.         case kMarkInterestingButton:
  463.             return (GetHighlightedReference()<0);
  464.     }
  465.     
  466.     return TRUE;
  467. }
  468.  
  469. static    void SetTheBuildMessage(WindowPtr theWindow, short messageIndex, Boolean redraw)
  470. {
  471.     if (messageIndex>0)
  472.         GetIndString(gTheMessage, kBuildMessagesID, messageIndex);
  473.     gTheMessageID=messageIndex;
  474.     if (redraw)
  475.         DrawTheBuildMessage(theWindow, FALSE);
  476. }
  477.  
  478. static    void DrawBuildHeader(WindowPtr theWindow, short theDepth)
  479. {
  480.     Rect            tempRect;
  481.     RGBColor        background4={32767, 32767, 32767};
  482.     RGBColor        background8={30802, 30802, 30802};
  483.     PixPatHandle    backgroundppat;
  484.     short            width;
  485.     short            headerHeight;
  486.     GrafPtr            curPort;
  487.     
  488.     headerHeight=kHeaderHeight;
  489.     
  490.     GetPort(&curPort);
  491.     tempRect=curPort->portRect;
  492.     tempRect.bottom=tempRect.top+headerHeight-1;
  493.     
  494.     if (theDepth>2)
  495.     {
  496.         backgroundppat=NewPixPat();
  497.         MakeRGBPat(backgroundppat, (theDepth==4) ? &background4: &background8);
  498.         FillCRect(&tempRect, backgroundppat);
  499.         DisposePixPat(backgroundppat);
  500.     }
  501.     else
  502.     {
  503.         EraseRect(&tempRect);
  504.     }
  505.     
  506.     width=curPort->portRect.right-curPort->portRect.left;
  507.     MoveTo(0, headerHeight-1);
  508.     Line(width, 0);
  509.     
  510.     UpdateBuildButtons(theWindow, FALSE);
  511.     
  512.     if (gShowMessageBox)
  513.         DrawTheBuildMessage(theWindow, TRUE);
  514. }
  515.  
  516. static    void DrawTheBuildMessage(WindowPtr theWindow, Boolean drawFrame)
  517. {
  518.     Rect            tempRect;
  519.     short            headerHeight;
  520.     
  521.     headerHeight=kHeaderHeight;
  522.     tempRect=theWindow->portRect;
  523.     tempRect.right-=DEAD_SPACE_H;
  524.     tempRect.left+=DEAD_SPACE_H;
  525.     tempRect.bottom=tempRect.top+headerHeight-DEAD_SPACE_H;
  526.     tempRect.top=tempRect.bottom-MESSAGE_HEIGHT;
  527.     if (drawFrame)
  528.     {
  529.         DrawTheShadowBox(tempRect, TRUE);
  530.         InsetRect(&tempRect, 3, 3);
  531.     }
  532.     else
  533.     {
  534.         InsetRect(&tempRect, 3, 3);
  535.         EraseRect(&tempRect);
  536.     }
  537.     
  538.     if (gTheMessageID>0)
  539.     {
  540.         MoveTo(tempRect.left+5, tempRect.bottom-4);
  541.         TextFont(geneva);
  542.         TextSize(9);
  543.         TextMode(srcOr);
  544.         DrawString(gTheMessage);
  545.     }
  546. }
  547.  
  548. void UpdateBuildButtons(WindowPtr theWindow, Boolean onlyIfChanged)
  549. {
  550.     short            i;
  551.     short            theDepth;
  552.     
  553.     if (!gShowToolbar)
  554.         return;
  555.     
  556.     theDepth=GetWindowDepth(theWindow);
  557.     for (i=0; i<NUM_BUTTONS; i++)
  558.     {
  559.         if ((!onlyIfChanged) || (ButtonIsDimmedQQ(theWindow, i)!=gOldButtonState[i]))
  560.             Draw3DButton(&gButtonRect[i], 0L, gButtonIcon[i], theDepth, FALSE,
  561.                 ButtonIsDimmedQQ(theWindow, i), FALSE);
  562.     }
  563. }
  564.  
  565. short GetBuildHeaderHeight(void)
  566. {
  567.     return kHeaderHeight;
  568. }
  569.  
  570. void RememberBuildButtonState(WindowPtr theWindow)
  571. {
  572.     short            i;
  573.     
  574.     for (i=0; i<NUM_BUTTONS; i++)
  575.         gOldButtonState[i]=ButtonIsDimmedQQ(theWindow, i);
  576. }
  577.  
  578. void SetBuildWindowTitle(Str255 theTitle)
  579. {
  580.     Mymemcpy((Ptr)gBuildWindowTitle, (Ptr)theTitle, theTitle[0]+1);
  581. }
  582.